package algorithm.leetcode;

public class ListNode {
    public int val;
    public ListNode next;

    public ListNode(int x) {
        val = x;
    }

    @Override
    public String toString() {
        return val + " -> " + next;
    }

    // @Override
    // public String toString() {
    //     return val + " -> " + next.val;
    // }
}
